///*
// * To change this template, choose Tools | Templates
// * and open the template in the editor.
// */
//package candidate.beans;
//
//import candidate.ejb.VideoProcesingEjb;
//import facades.CandidateEducationalInfoFacade;
//import facades.CandidateFacade;
//import facades.CandidateInterestAreaFacade;
//import facades.CandidateLanguageInfoFacade;
//import facades.CandidateProfessionalInfoFacade;
//import facades.CandidateRelocatingInfoFacade;
//import entities.Candidate;
//import entities.CandidateEducationalInfo;
//import entities.CandidateInterestArea;
//import entities.CandidateLanguageInfo;
//import entities.CandidateProfessionalInfo;
//import entities.CandidateRelocatingInfo;
//import util.ImageStoreHelper;
//import util.PrimeFacesBufferedImage;
//import java.io.File;
//import java.io.FileNotFoundException;
//import java.io.IOException;
//import java.io.Serializable;
//import java.util.ArrayList;
//import java.util.Date;
//import java.util.Iterator;
//import java.util.Locale;
//import java.util.ResourceBundle;
//import javax.annotation.PostConstruct;
//import javax.enterprise.context.SessionScoped;
//import javax.enterprise.event.Event;
//import javax.enterprise.event.Observes;
//import javax.faces.application.FacesMessage;
//import javax.faces.context.FacesContext;
//import javax.inject.Inject;
//import javax.inject.Named;
//import org.primefaces.event.FileUploadEvent;
//import candidate.qualifiers.UpdatedImagesEvent;
//import candidate.qualifiers.UploadedVideoEvent;
//import entities.CandidateTags;
//import facades.CandidateTagsFacade;
//import java.util.List;
//import java.util.Map;
//import org.primefaces.event.SelectEvent;
//import qualifiers.EditedEntityEvent;
//import qualifiers.LoggedIn;
//
///**
// *
// * @author damfercer
// */
//@Named
//@SessionScoped
//public class EditCandidateBean implements Serializable {
//    @Inject
//    @UpdatedImagesEvent
//    private Event<Integer> updatedImagesEvent;
//    @Inject
//    CandidateFacade candidateEJB;
//    @Inject
//    CandidateEducationalInfoFacade candidateEducationalInfoEJB;
//    @Inject
//    CandidateProfessionalInfoFacade candidateProfessionalInfoEJB;
//    @Inject
//    CandidateLanguageInfoFacade candidateLanguageInfoEJB;
//    @Inject
//    CandidateInterestAreaFacade candidateInterestAreaEJB;
//    @Inject
//    CandidateRelocatingInfoFacade candidateRelocatingInfoEJB;
//    @Inject
//    @LoggedIn
//    private Candidate candidate;
//    @Inject
//    private VideoProcesingEjb videoProcesingEjb;
//    @Inject 
//    private CandidateTagsFacade candidateTagsFacade;
//    private CandidateTags newCandidateTag;
//
//    
//    
//    //Image fields
//    private PrimeFacesBufferedImage chosenColorBustImage;
//    private PrimeFacesBufferedImage chosenBustImage;
//    private PrimeFacesBufferedImage chosenBodyImage;
//    private CandidateEducationalInfo collectorEducationalInfo;
//    private CandidateProfessionalInfo collectorProfessionalInfo;
//    private CandidateProfessionalInfo selectedProfessionalInfo;
//    private CandidateLanguageInfo collectorLanguageInfo;
//    private CandidateInterestArea collectorInterestArea;
//    private CandidateRelocatingInfo collectorRelocatingInfo;
//    //Show videos
//    private CandidateLanguageInfo selectedCurrentVideo;
//    private CandidateLanguageInfo selectedEditVideo;
//    private Boolean showTutorial;
//    private Boolean scrollToPictures;
//    private Boolean scrollToLanguages;
//    private Boolean scrollToPersonal;
//
//    @Inject
//    @EditedEntityEvent
//    private Event<Candidate> updatedCandidateEvent;
//
//    /**
//     * Creates a new instance of createCandidateBean
//     */
//    public EditCandidateBean() {
//        showTutorial=false;
//        scrollToLanguages=false;
//        scrollToPersonal=false;
//        scrollToPictures=false;
//    }
//
//    @PostConstruct
//    public void fillCandidateBean(){
//        if(getCandidate().getCandidateEducationalInfoList()==null){
//            getCandidate().setCandidateEducationalInfoList(new ArrayList<CandidateEducationalInfo>());
//        }
//        if(getCandidate().getCandidateProfessionalInfoList()==null){
//            getCandidate().setCandidateProfessionalInfoList(new ArrayList<CandidateProfessionalInfo>());
//        }
//        if(getCandidate().getCandidateLanguageInfoList()==null){
//            getCandidate().setCandidateLanguageInfoList(new ArrayList<CandidateLanguageInfo>());
//        }
//        if(getCandidate().getCandidateInterestAreaList()==null){
//            getCandidate().setCandidateInterestAreaList(new ArrayList<CandidateInterestArea>());
//        }
//        if(getCandidate().getCandidateRelocatingInfoList()==null){
//            getCandidate().setCandidateRelocatingInfoList(new ArrayList<CandidateRelocatingInfo>());
//        }
//        collectorEducationalInfo=new CandidateEducationalInfo();
//        collectorProfessionalInfo=new CandidateProfessionalInfo();
//        collectorLanguageInfo=new CandidateLanguageInfo();
//        collectorInterestArea=new CandidateInterestArea();
//        collectorRelocatingInfo=new CandidateRelocatingInfo();
//        newCandidateTag= new CandidateTags();
//    }
//    
//    public void reinitEditCandidateBean(){
//        chosenBodyImage=null;
//        chosenBustImage=null;
//        chosenColorBustImage=null;
//        collectorEducationalInfo=new CandidateEducationalInfo();
//        collectorProfessionalInfo=new CandidateProfessionalInfo();
//        collectorLanguageInfo=new CandidateLanguageInfo();
//        collectorInterestArea=new CandidateInterestArea();
//        collectorRelocatingInfo=new CandidateRelocatingInfo();
//    }
//    
//    public String reinitCollectorEducationalInfo() { 
//        collectorEducationalInfo = new CandidateEducationalInfo();  
//        return null;  
//    }
//    
//    public void saveEducationalInfo(CandidateEducationalInfo item){
//        
//    }
//    
//    public String reinitCollectorProfessionalInfo() { 
//        collectorProfessionalInfo=new CandidateProfessionalInfo();  
//        return null;  
//    }
//    
//    public String reinitCollectorLanguageInfo() { 
//        collectorLanguageInfo=new CandidateLanguageInfo(); 
//        return null;  
//    }
//    
//    public String reinitCollectorInterestArea() { 
//        collectorInterestArea=new CandidateInterestArea(); 
//        return null;  
//    }
//    
//    public String reinitCollectorRelocatingInfo() { 
//        collectorRelocatingInfo=new CandidateRelocatingInfo(); 
//        return null;  
//    }
//
//    
//    public void editAndShowResponse(){
//        Date date = new Date();
//        getCandidate().getUser().setLastDate(date);
//        getCandidate().setLastModificationDate(date);
//        candidateEJB.edit(getCandidate());
//        FacesContext context=FacesContext.getCurrentInstance();
//        Locale locale=context.getViewRoot().getLocale();
//        ResourceBundle rb = ResourceBundle.getBundle("messages", locale);
//        String successMessage=rb.getString("UpdatedSuccessfully");
//        FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, successMessage, successMessage);  
//        context.addMessage(null, message); 
//        context.renderResponse();
//        updatedCandidateEvent.fire(candidate);
//    }
//    
//    public void editImages() throws IOException{
//        if(chosenColorBustImage!=null){
//            getCandidate().setBustColor(ImageStoreHelper.storePrimeFacesBufferedImage(chosenColorBustImage));                
//        }
//        if(chosenBustImage!=null){
//            getCandidate().setBustBlackWhite(ImageStoreHelper.storePrimeFacesBufferedImage(chosenBustImage));
//        }
//        if(chosenBodyImage!=null){
//            getCandidate().setBodyFormal(ImageStoreHelper.storePrimeFacesBufferedImage(chosenBodyImage));
//        }
//        if(chosenColorBustImage!=null && chosenBustImage!=null && chosenBodyImage!=null){
//            updateImages();
//        }
//        updatedImagesEvent.fire(0);
//        editAndShowResponse();
//    }
//    
//    public void editPersonal(){
//        editAndShowResponse();
//    }
//    
//    public void saveProfessional(){
//        collectorProfessionalInfo.setCandidate(getCandidate());
//        if(getCandidate().getCandidateProfessionalInfoList().contains(collectorProfessionalInfo)){
//            for(Iterator<CandidateProfessionalInfo> iter=getCandidate().getCandidateProfessionalInfoList().iterator();iter.hasNext();){
//                CandidateProfessionalInfo old=iter.next();
//                if(old.equals(collectorProfessionalInfo)){
//                    candidateProfessionalInfoEJB.remove(old);
//                    iter.remove();
//                }
//            }
//        }
//        candidateProfessionalInfoEJB.create(collectorProfessionalInfo);
//        getCandidate().getCandidateProfessionalInfoList().add(collectorProfessionalInfo);
//        collectorProfessionalInfo=new CandidateProfessionalInfo();
//        editAndShowResponse();
//    }
//    
//     public void editProfessional(){
//        candidateProfessionalInfoEJB.edit(selectedProfessionalInfo);
//        editAndShowResponse();
//    }
//    
//    public void saveEducational(){
//        collectorEducationalInfo.setCandidate(getCandidate());
//        if(getCandidate().getCandidateEducationalInfoList().contains(collectorEducationalInfo)){
//            for(Iterator<CandidateEducationalInfo> iter=getCandidate().getCandidateEducationalInfoList().iterator();iter.hasNext();){
//                CandidateEducationalInfo old=iter.next();
//                if(old.equals(collectorEducationalInfo)){
//                    candidateEducationalInfoEJB.remove(old);
//                    iter.remove();
//                }
//            }
//        }
//        candidateEducationalInfoEJB.create(collectorEducationalInfo);            
//        getCandidate().getCandidateEducationalInfoList().add(collectorEducationalInfo);
//        collectorEducationalInfo=new CandidateEducationalInfo();
//        editAndShowResponse();
//    }
//    
//    public void saveLanguage() throws FileNotFoundException, IOException{
//        collectorLanguageInfo.setCandidate(getCandidate());
//        if(getCandidate().getCandidateLanguageInfoList().contains(collectorLanguageInfo)){
//            for(Iterator<CandidateLanguageInfo> iter=getCandidate().getCandidateLanguageInfoList().iterator();iter.hasNext();){
//                CandidateLanguageInfo old=iter.next();
//                if(old.equals(collectorLanguageInfo)){
//                    candidateLanguageInfoEJB.remove(old);
//                    iter.remove();
//                }
//            }
//
//        }
//        candidateLanguageInfoEJB.create(collectorLanguageInfo);
//        getCandidate().getCandidateLanguageInfoList().add(collectorLanguageInfo);
//        collectorLanguageInfo=new CandidateLanguageInfo();
//        editAndShowResponse();
//    }
//    
//    public void saveRelocating(){
//        collectorRelocatingInfo.setCandidate(getCandidate());
//        if(getCandidate().getCandidateRelocatingInfoList().contains(collectorRelocatingInfo)){
//            for(Iterator<CandidateRelocatingInfo> iter=getCandidate().getCandidateRelocatingInfoList().iterator();iter.hasNext();){
//                CandidateRelocatingInfo old=iter.next();
//                if(old.equals(collectorRelocatingInfo)){
//                    candidateRelocatingInfoEJB.remove(old);
//                    iter.remove();
//                }
//            }
//        }
//        candidateRelocatingInfoEJB.create(collectorRelocatingInfo);
//        getCandidate().getCandidateRelocatingInfoList().add(collectorRelocatingInfo);
//        collectorRelocatingInfo=new CandidateRelocatingInfo();
//        editAndShowResponse();
//    }
//    
//    public void saveInterest(){
//        collectorInterestArea.setCandidate(getCandidate());
//        if(getCandidate().getCandidateInterestAreaList().contains(collectorInterestArea)){
//            for(Iterator<CandidateInterestArea> iter=getCandidate().getCandidateInterestAreaList().iterator();iter.hasNext();){
//                CandidateInterestArea old=iter.next();
//                if(old.equals(collectorInterestArea)){
//                    candidateInterestAreaEJB.remove(old);
//                    iter.remove();
//                }
//            }
//        }
//        candidateInterestAreaEJB.create(collectorInterestArea);
//        getCandidate().getCandidateInterestAreaList().add(collectorInterestArea);
//        collectorInterestArea=new CandidateInterestArea();
//        editAndShowResponse();
//    }
//    
//    public void updateImages() throws FileNotFoundException, IOException{
//        File colorBustFile=new File(ImageStoreHelper.pathToStoringFolder+getCandidate().getBustColor());
//        File newColorBustFile=new File(ImageStoreHelper.pathToPersistentStore+"/"+getCandidate().getIdCandidate().toString()+"/"+"images/"+getCandidate().getBustColor());
//        File bwBustFile=new File(ImageStoreHelper.pathToStoringFolder+getCandidate().getBustBlackWhite());
//        File newBWBustTile=new File(ImageStoreHelper.pathToPersistentStore+"/"+getCandidate().getIdCandidate().toString()+"/"+"images/"+getCandidate().getBustBlackWhite());
//        File bodyFormalFile=new File(ImageStoreHelper.pathToStoringFolder+getCandidate().getBodyFormal());
//        File newBodyFormalFile=new File(ImageStoreHelper.pathToPersistentStore+"/"+getCandidate().getIdCandidate().toString()+"/"+"images/"+getCandidate().getBodyFormal());
//        ImageStoreHelper.copyAndDelete(colorBustFile, newColorBustFile);
//        ImageStoreHelper.copyAndDelete(bodyFormalFile, newBodyFormalFile);
//        ImageStoreHelper.copyAndDelete(bwBustFile, newBWBustTile);
//        
//    }
//    
//    public void createdCandidateTag() throws Exception{
//        boolean res=candidateTagsFacade.candidateHasThisTag(candidate, newCandidateTag.getTag());
//
//        if(!res &&candidate.getCandidateTagsList().size()<40){
//            newCandidateTag.setCandidate(candidate);
//            newCandidateTag.setTag(newCandidateTag.getTag().toLowerCase());
//            candidateTagsFacade.create(newCandidateTag);
//            candidate.getCandidateTagsList().add(newCandidateTag);
//        }
//        if(candidate.getCandidateTagsList().size()>39){            
//            FacesContext context=FacesContext.getCurrentInstance();
//            Locale locale=context.getViewRoot().getLocale();
//            ResourceBundle rb = ResourceBundle.getBundle("messages", locale);
//            String successMessage=rb.getString("LimitSkillsReached");
//            FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, successMessage, successMessage);  
//            context.addMessage(null, message); 
//            context.renderResponse();
//        }
//        else{
//            editAndShowResponse();
//        }
//        newCandidateTag= new CandidateTags();
//    }
//    
//    public void removeCandidateTag(CandidateTags  candidateTags){
//        candidateTagsFacade.remove(candidateTags);
//        candidate.getCandidateTagsList().remove(candidateTags);
//        editAndShowResponse();
//    }
//    
//    public List<String>autocompleteTags(String query){
//        List<String>res= candidateTagsFacade.similarTags(query.toLowerCase());
//        return res;
//    }
//    
//    public void setSelectecAutocompleteItem(SelectEvent event) {
//        String string =(String) event.getObject();
//        newCandidateTag.setTag(string);
//    }
//    
//    public String getIdFromCandidateLanguageInfo(CandidateLanguageInfo cli){
//        String res=null;
//        if(cli!=null){
//            String[] array=cli.getVideo().split("\\.");
//            res=array[0];
//        }
//        return res;
//    }
//    
//    public void removeCandidateEducationalInfo(CandidateEducationalInfo educInfo){
//        candidateEducationalInfoEJB.remove(educInfo);
//    }
//    
//    public void removeCandidateProfessionalInfo(CandidateProfessionalInfo profInfo){
//        candidateProfessionalInfoEJB.remove(profInfo);
//    }
//    
//    public void removeCandidateLanguageInfo(CandidateLanguageInfo langInfo){
//        candidateLanguageInfoEJB.remove(langInfo);
//    }
//    
//    public void removeCandidateRelocatingInfo(CandidateRelocatingInfo relInfo){
//        candidateRelocatingInfoEJB.remove(relInfo);
//    }
//    
//    public void removeCandidateInterestArea(CandidateInterestArea intArea){
//        candidateInterestAreaEJB.remove(intArea);
//    }
//    
//    /**
//     * @return the candidate
//     */
//    public Candidate getCandidate() {
//        return candidate;
//    }
//
//    /**
//     * @param candidate the candidate to set
//     */
//    public void setCandidate(Candidate candidate) {
//        this.candidate = candidate;
//    }
//
//    /**
//     * @return the chosenBustImage
//     */
//    public PrimeFacesBufferedImage getChosenBustImage() {
//        return chosenBustImage;
//    }
//
//    /**
//     * @param chosenBustImage the chosenBustImage to set
//     */
//    public void setChosenBustImage(PrimeFacesBufferedImage chosenBustImage) {
//        this.chosenBustImage = chosenBustImage;
//    }
//
//    /**
//     * @return the chosenBodyImage
//     */
//    public PrimeFacesBufferedImage getChosenBodyImage() {
//        return chosenBodyImage;
//    }
//
//    /**
//     * @param chosenBodyImage the chosenBodyImage to set
//     */
//    public void setChosenBodyImage(PrimeFacesBufferedImage chosenBodyImage) {
//        this.chosenBodyImage = chosenBodyImage;
//    }
//
//    /**
//     * @return the collectorEducationalInfo
//     */
//    public CandidateEducationalInfo getCollectorEducationalInfo() {
//        return collectorEducationalInfo;
//    }
//
//    /**
//     * @param collectorEducationalInfo the collectorEducationalInfo to set
//     */
//    public void setCollectorEducationalInfo(CandidateEducationalInfo collectorEducationalInfo) {
//        this.collectorEducationalInfo = collectorEducationalInfo;
//    }
//
//    /**
//     * @return the collectorProfessionalInfo
//     */
//    public CandidateProfessionalInfo getCollectorProfessionalInfo() {
//        return collectorProfessionalInfo;
//    }
//
//    /**
//     * @param collectorProfessionalInfo the collectorProfessionalInfo to set
//     */
//    public void setCollectorProfessionalInfo(CandidateProfessionalInfo collectorProfessionalInfo) {
//        this.collectorProfessionalInfo = collectorProfessionalInfo;
//    }
//
//    /**
//     * @return the collectorLanguageInfo
//     */
//    public CandidateLanguageInfo getCollectorLanguageInfo() {
//        return collectorLanguageInfo;
//    }
//
//    /**
//     * @param collectorLanguageInfo the collectorLanguageInfo to set
//     */
//    public void setCollectorLanguageInfo(CandidateLanguageInfo collectorLanguageInfo) {
//        this.collectorLanguageInfo = collectorLanguageInfo;
//    }
//
//    /**
//     * @return the collectorInterestArea
//     */
//    public CandidateInterestArea getCollectorInterestArea() {
//        return collectorInterestArea;
//    }
//
//    /**
//     * @param collectorInterestArea the collectorInterestArea to set
//     */
//    public void setCollectorInterestArea(CandidateInterestArea collectorInterestArea) {
//        this.collectorInterestArea = collectorInterestArea;
//    }
//
//    /**
//     * @return the collectorRelocatingInfo
//     */
//    public CandidateRelocatingInfo getCollectorRelocatingInfo() {
//        return collectorRelocatingInfo;
//    }
//
//    /**
//     * @param collectorRelocatingInfo the collectorRelocatingInfo to set
//     */
//    public void setCollectorRelocatingInfo(CandidateRelocatingInfo collectorRelocatingInfo) {
//        this.collectorRelocatingInfo = collectorRelocatingInfo;
//    }
//
//    /**
//     * @return the chosenColorBustImage
//     */
//    public PrimeFacesBufferedImage getChosenColorBustImage() {
//        return chosenColorBustImage;
//    }
//
//    /**
//     * @param chosenColorBustImage the chosenColorBustImage to set
//     */
//    public void setChosenColorBustImage(PrimeFacesBufferedImage chosenColorBustImage) {
//        this.chosenColorBustImage = chosenColorBustImage;
//    }
//
//    /**
//     * @return the selectedCurrentVideo
//     */
//    public CandidateLanguageInfo getSelectedCurrentVideo() {
//        return selectedCurrentVideo;
//    }
//
//    /**
//     * @param selectedCurrentVideo the selectedCurrentVideo to set
//     */
//    public void setSelectedCurrentVideo(CandidateLanguageInfo selectedCurrentVideo) {
//        this.selectedCurrentVideo = selectedCurrentVideo;
//    }
//
//    /**
//     * @return the selectedEditVideo
//     */
//    public CandidateLanguageInfo getSelectedEditVideo() {
//        return selectedEditVideo;
//    }
//
//    /**
//     * @param selectedEditVideo the selectedEditVideo to set
//     */
//    public void setSelectedEditVideo(CandidateLanguageInfo selectedEditVideo) {
//        this.selectedEditVideo = selectedEditVideo;
//    }
//
//    /**
//     * @return the showTutorial
//     */
//    public Boolean getShowTutorial() {
//        if(showTutorial){
//            showTutorial=false;
//            return true;
//        }
//        return showTutorial;
//    }
//
//    /**
//     * @param showTutorial the showTutorial to set
//     */
//    public void setShowTutorial(Boolean showTutorial) {
//        this.showTutorial = showTutorial;
//    }
//
//    /**
//     * @return the scrollToPictures
//     */
//    public Boolean getScrollToPictures() {
//        return scrollToPictures;
//    }
//
//    /**
//     * @param scrollToPictures the scrollToPictures to set
//     */
//    public void setScrollToPictures(Boolean scrollToPictures) {
//        this.scrollToPictures = scrollToPictures;
//    }
//
//    /**
//     * @return the scrollToLanguages
//     */
//    public Boolean getScrollToLanguages() {
//        return scrollToLanguages;
//    }
//
//    /**
//     * @param scrollToLanguages the scrollToLanguages to set
//     */
//    public void setScrollToLanguages(Boolean scrollToLanguages) {
//        this.scrollToLanguages = scrollToLanguages;
//    }
//
//    /**
//     * @return the scrollToPersonal
//     */
//    public Boolean getScrollToPersonal() {
//        return scrollToPersonal;
//    }
//
//    /**
//     * @param scrollToPersonal the scrollToPersonal to set
//     */
//    public void setScrollToPersonal(Boolean scrollToPersonal) {
//        this.scrollToPersonal = scrollToPersonal;
//    }
//    
//    public void onUploadedVideo(@Observes @UploadedVideoEvent String videoName){
//        collectorLanguageInfo.setVideo(videoName);
//    }
//    
//    public void setVideoToCandidate(FileUploadEvent event){
//        try{
//            collectorLanguageInfo.setVideo("0");
//            collectorLanguageInfo.setCandidate(candidate);
//            candidateLanguageInfoEJB.create(collectorLanguageInfo);
//            getCandidate().getCandidateLanguageInfoList().add(collectorLanguageInfo);
//            candidateEJB.edit(candidate);
// 
//            videoProcesingEjb.storeTemporaryVideo(event.getFile(),candidate,collectorLanguageInfo,candidateLanguageInfoEJB);
//            collectorLanguageInfo= new CandidateLanguageInfo();
//            FacesContext context = FacesContext.getCurrentInstance();
//            Locale locale=context.getViewRoot().getLocale();
//            ResourceBundle rb = ResourceBundle.getBundle("messages", locale);
//            String successMessage=rb.getString("VideoUploadSuccess");
//            FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, successMessage, successMessage);  
//            context.addMessage(null, message); 
//            context.renderResponse();
//        }
//        catch(Exception e){
//            System.out.println(e.getMessage());
//        }
//    }
//    
//    public void onNewVideoUpdated(){
//        FacesContext context = FacesContext.getCurrentInstance();
//        Map map = context.getExternalContext().getRequestParameterMap();
//        String idCandidateLanguageInfoString = (String) map.get("candidateLanguageInfo");
//        Integer idCandidateLanguageInfo = null;
//        try {
//            idCandidateLanguageInfo=new Integer(idCandidateLanguageInfoString);
//        } catch (NumberFormatException e) {
//        }
//        CandidateLanguageInfo candidateLanguageInfo = null;
//        if(idCandidateLanguageInfo!=null){
//            candidateLanguageInfo = candidateLanguageInfoEJB.find(idCandidateLanguageInfo);
//            for(CandidateLanguageInfo la:candidate.getCandidateLanguageInfoList()){
//                if(la.getIdCandidateLanguageInfo()==idCandidateLanguageInfo){
//                    candidate.getCandidateLanguageInfoList().remove(la);
//                    candidate.getCandidateLanguageInfoList().add(candidateLanguageInfo);
//                }
//            }
//        }
//        else{
//            System.out.println("Notificación nula");
//        }
//        
//        Locale locale=context.getViewRoot().getLocale();
//        ResourceBundle rb = ResourceBundle.getBundle("messages", locale);
//        String successMessage=rb.getString("VideoAddedSuccess");
//        FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, successMessage, successMessage);  
//        context.addMessage(null, message); 
//        context.renderResponse();
//    }
//
//    /**
//     * @return the selectedProfessionalInfo
//     */
//    public CandidateProfessionalInfo getSelectedProfessionalInfo() {
//        return selectedProfessionalInfo;
//    }
//
//    /**
//     * @param selectedProfessionalInfo the selectedProfessionalInfo to set
//     */
//    public void setSelectedProfessionalInfo(CandidateProfessionalInfo selectedProfessionalInfo) {
//        this.selectedProfessionalInfo = selectedProfessionalInfo;
//    }
//
//    /**
//     * @return the newCandidateTag
//     */
//    public CandidateTags getNewCandidateTag() {
//        return newCandidateTag;
//    }
//
//    /**
//     * @param newCandidateTag the newCandidateTag to set
//     */
//    public void setNewCandidateTag(CandidateTags newCandidateTag) {
//        this.newCandidateTag = newCandidateTag;
//    }
//}
